/*
# Rouleur Log - A log for cyclists.
# Copyright (C) 2006  Edward Copony (ecopony@gmail.com)
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
package com.blazingredfireball.rouleurlog.ria.control
{
	import com.adobe.cairngorm.control.FrontController;
	import com.blazingredfireball.rouleurlog.ria.event.*;
	import com.blazingredfireball.rouleurlog.ria.command.*;
	
	public class RouleurlogController extends FrontController
	{
		public function RouleurlogController()
		{
			initialiseCommands();
		}
		
		public function initialiseCommands() : void
		{
			addCommand( CreateRideEvent.EVENT_CREATE_RIDE, CreateRideCommand);
			addCommand( GetRidesEvent.EVENT_GET_RIDES, GetRidesCommand);
			addCommand( UpdateRideEvent.EVENT_UPDATE_RIDE, UpdateRideCommand);
			addCommand( DeleteRideEvent.EVENT_DELETE_RIDE, DeleteRideCommand);
			
			addCommand( LoginEvent.EVENT_LOGIN, LoginCommand);
			addCommand( RegisterEvent.EVENT_REGISTER, RegisterCommand);
			
  		addCommand( CreateBikeEvent.EVENT_CREATE_BIKE, CreateBikeCommand );
			addCommand( GetBikesEvent.EVENT_GET_BIKES, GetBikesCommand );
			addCommand( UpdateBikeEvent.EVENT_UPDATE_BIKE, UpdateBikeCommand );
			addCommand( DeleteBikeEvent.EVENT_DELETE_BIKE, DeleteBikeCommand );
			
			addCommand( CreateRouteEvent.EVENT_CREATE_ROUTE, CreateRouteCommand );
			addCommand( GetRoutesEvent.EVENT_GET_ROUTES, GetRoutesCommand );
			addCommand( UpdateRouteEvent.EVENT_UPDATE_ROUTE, UpdateRouteCommand );
			addCommand( DeleteRouteEvent.EVENT_DELETE_ROUTE, DeleteRouteCommand );
			
			addCommand( ChangeThemeEvent.EVENT_CHANGE_THEME, ChangeThemeCommand );
			
		}	
	}
}